package com.hezhou.oauth2.web.controller;

import com.hezhou.base.result.HezhouResult;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * ---------------------------
 * (ProductController) 这是商品的controller
 * ---------------------------
 *
 * @Author: [hezhou]
 * @Date: 2020/3/13
 * @Version: [1.0.1]
 * ---------------------------
 */
@RestController
@RequestMapping("/product")
public class ProductController {

    @GetMapping("/list")
    @PreAuthorize("hasAuthority('sys:role:list')")
    public HezhouResult list(){
        List<String> list = new ArrayList<>();
        list.add("眼镜");
        list.add("格子衬衫");
        list.add("大皮鞋");
        list.add("电脑包");
        list.add("保温杯");
        return HezhouResult.ok(list);
    }
}
